package com.neshai.webapp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neshai.webapp.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Update("UPDATE user SET usage_basic = usage_basic + 1 WHERE user_id = #{user_id}")
    int incrementUsageBasicById(@Param("user_id") int userId);

    @Update("UPDATE user SET usage_premium = usage_premium + 1 WHERE user_id = #{user_id}")
    int incrementUsagePremiumById(@Param("user_id") int userId);
}
